package com.sanmao.spring.demo.security.springsecurityoauth2demo.handler;

import lombok.extern.slf4j.Slf4j;
import org.springframework.security.core.Authentication;
import org.springframework.security.web.authentication.SavedRequestAwareAuthenticationSuccessHandler;
import org.springframework.stereotype.Component;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * 校验成功处理流程
 * @Author: Sanmao
 * @Date: 2021/08/31/11:48
 * @Description:
 */
@Slf4j
@Component("dmAuthenticationSuccessHandler")
public class DmAuthenticationSuccessHandler extends SavedRequestAwareAuthenticationSuccessHandler {

  @Override
  public void onAuthenticationSuccess(HttpServletRequest request, HttpServletResponse response,
    Authentication authentication) throws ServletException, IOException {
    log.info("authentication success!!!");
    super.onAuthenticationSuccess(request, response, authentication);
  }
}
